<template>
    <h1>监听ref的多个属性</h1>
    <div>
        姓名: <input type="text" v-model="name"><br>
        年龄：<input type="text" v-model="age"><br>
        职业:<input type="text" v-model="job"><br>
    </div>
</template>

<script>
import { ref } from '@vue/reactivity'
import { watch } from '@vue/runtime-core'
export default {
 setup(){
    let name=ref("Giles")
    let age=ref(23)
    let job=ref("teacher")
    watch([name,job],(newval,oldval)=>{
        console.log(newval,oldval);
    },{immediate:true})
    return{name,age,job}
 }
}
</script>

<style>

</style>